<!DOCTYPE html>
<html lang="ru" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Update person</title>
    <style>
        .error {
            color: red;
        }
    </style>
</head>
<body>

<form th:action="@{/people/{id}(id=${person.getId()})}" th:method="PATCH" th:object="${person}">
    <p>
        <label for="name">Введите ФИО: </label>
        <input id="name" th:field="*{name}" type="text"/>
    </p>
    <p class="error" th:errors="*{name}" th:if="${#fields.hasErrors('name')}">Name Error</p>
    <p>
        <label for="birthYear">Введите год рождения: </label>
        <input id="birthYear" th:field="*{birthYear}" type="text"/>
    </p>
    <p class="error" th:errors="*{birthYear}" th:if="${#fields.hasErrors('birthYear')}">Birth Error</p>
    <button type="submit">Редактировать</button>
</form>

</body>
</html>